package com.centerm.eterm.ui.enquireAndPrint;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;

import javax.swing.JCheckBox;

public class CJCheckBox extends JCheckBox implements ItemListener
{

	public CJCheckBox(String s)
	{
		super(s);
		addItemListener(this);
	}

	public void paintComponent(Graphics g)
	{
		super.paintComponent(g);
		if (isSelected())
		{
			g.setXORMode(this.getBackground());
			g.setColor(Color.blue);
			int x = 21, y = 3;
			// g.fillRect(x, y, getWidth() - x - 8, getHeight() - y * 2 - 1);
			g.fillRect(x, y, getWidth() - x - 3, getHeight() - y * 2 - 1);
			g.fillRect(5, 7, 10, 12);
		}
	}

	public void itemStateChanged(ItemEvent e)
	{
		repaint();
	}

}
